<template>
  <div>
    <!-- el-row 行  el-col列 -->
    <!-- 1行一个 24 -->
    <el-row style="height:40px">
      <el-col :span="24" style="height:100%;background-color:green" />

    </el-row>

    <!-- 1行2个 12 -->
    <el-row style="height:40px">
      <el-col :span="12" style="height:100%;background-color:pink" />
      <el-col :span="12" style="height:100%;background-color:skyblue" />
    </el-row>

    <!-- 1行3个 8 -->
    <el-row style="height:40px">
      <el-col :span="8" style="height:100%;background-color:yellowgreen" />
      <el-col :span="8" style="height:100%;background-color:teal" />
      <el-col :span="8" style="height:100%;background-color:blue" />
    </el-row>

    <!-- 分栏间隔 Row 组件 提供 gutter 属性来指定每一栏之间的间隔，默认间隔为 0。 -->
    <el-row :gutter="20">
      <el-col :span="6"><div class="grid-content bg-purple" /></el-col>
      <el-col :span="6"><div class="grid-content bg-purple" /></el-col>
      <el-col :span="6"><div class="grid-content bg-purple" /></el-col>
      <el-col :span="6"><div class="grid-content bg-purple" /></el-col>
    </el-row>

    <!-- 弹性容器布局 -->
    <!-- justify	flex 布局下的水平排列方式  start/end/center/space-around/space-between-->
    <!-- align	flex 布局下的垂直排列方式  top/middle/bottom-->
    <el-row type="flex" align="middle" style="height:100px;border:1px solid black">
      <el-col style="height:40px;background:gold" />
    </el-row>

    <el-row type="flex" justify="space-around">
      <el-col :span="6" style="height:40px;background:teal" />
      <el-col :span="6" style="height:40px;background:pink" />
    </el-row>

    <!-- 嵌套 -->
    <el-row style="height:30px">
      <el-col style="height:30px;background:orange">
        <el-row>
          <el-col :span="8" style="height:100%;background:pink" />
          <el-col :span="8" style="height:100%;background:black" />
          <el-col :span="8" style="height:100%;background:green" />
        </el-row>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {

}
</script>

<style lang="scss" scoped>
.el-row {
    margin-bottom: 20px;
    &:last-child {
      margin-bottom: 0;
    }
  }
  .el-col {
    border-radius: 4px;
  }
  .bg-purple-dark {
    background: #99a9bf;
  }
  .bg-purple {
    background: #d3dce6;
  }
  .bg-purple-light {
    background: #e5e9f2;
  }
  .grid-content {
    border-radius: 4px;
    min-height: 36px;
  }
  .row-bg {
    padding: 10px 0;
    background-color: #f9fafc;
  }

</style>
